﻿<UserControl x:Class="View.DNNDetails"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
 <Grid Margin="10">
  <Grid.ColumnDefinitions>
   <ColumnDefinition Width="Auto" />
   <ColumnDefinition Width="6" />
   <ColumnDefinition Width="*" />
  </Grid.ColumnDefinitions>

  <Grid.RowDefinitions>
   <RowDefinition Height="Auto" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="Auto" />
   <RowDefinition Height="Auto" />
  </Grid.RowDefinitions>

  <Label 
      Grid.Row="0" Grid.Column="0" 
      Content="DNN Version:" 
      HorizontalAlignment="Right"
      />
  <Label 
      Grid.Row="0" Grid.Column="2" 
      HorizontalAlignment="Left"
   Content="{Binding ProjectSettings.DotNetNukeVersion}"
      />

  <Label 
      Grid.Row="1" Grid.Column="0" 
      Content="DNN Edition:" 
      HorizontalAlignment="Right"
      />
  <Label 
      Grid.Row="1" Grid.Column="2" 
      HorizontalAlignment="Left"
   Content="{Binding ProjectSettings.DotNetNukeType}"
      />

  <Label 
      Grid.Row="2" Grid.Column="0" 
      Content="Installed Locales:" 
      HorizontalAlignment="Right"
      />
  <ItemsControl ItemsSource="{Binding ProjectSettings.InstalledLanguages}" Grid.Row="2" Grid.Column="2" Margin="5">
   <ItemsControl.ItemTemplate>
    <DataTemplate>
     <StackPanel Orientation="Horizontal">
      <TextBlock Text="{Binding}" />
     </StackPanel>
    </DataTemplate>
   </ItemsControl.ItemTemplate>
  </ItemsControl>

  <Label 
      Grid.Row="3" Grid.Column="0" 
      Content="Installed Modules:" 
      HorizontalAlignment="Right"
      />
  <DataGrid Grid.Row="4" Grid.ColumnSpan="3"
            CanUserResizeRows="False"
            AutoGenerateColumns="false"
            ItemsSource="{Binding ProjectSettings.InstalledPackages}"
>
   <DataGrid.Columns>
    <DataGridTextColumn Binding="{Binding FriendlyName}" Width="SizeToCells" Header="Friendly Name" />
    <DataGridTextColumn Binding="{Binding Version}" Width="SizeToCells" Header="Version" />
    <DataGridTextColumn Binding="{Binding FolderName}" Width="SizeToCells" Header="Folder" />
   </DataGrid.Columns>
   <DataGrid.RowStyle>
    <Style>
     <Setter Property="DataGridRow.IsSelected" Value="{Binding Selected, Mode=TwoWay}" />
    </Style>
   </DataGrid.RowStyle>
  </DataGrid>

 </Grid>
</UserControl>
